import hashlib
import logging
import time

import allure

from common.base_request import BaseRequest
import pytest
import requests
from common.yaml_opt import YamlTools
sess =requests.session()
logindata =YamlTools.read_yaml_file("login.yaml")[0]


logging.info(f"epic的值为{logindata['request']['epic']}")
@allure.epic(logindata["request"]["epic"])
@allure.feature(logindata["request"]["feature"])
@allure.story(logindata["request"]["story"])
@pytest.mark.api
@pytest.mark.parametrize("mylogindata",logindata["parametrize"])
def testbanklogin(mylogindata):
    # print(mylogindata)
    data = mylogindata["data"]
    allure.dynamic.title(mylogindata["title"])
    res = BaseRequest.execute_api_request(request=logindata["request"], parametrize=mylogindata)
    print(res.json())
    assert res.json()["message"] == mylogindata["expect"]["msg"]
    
    
